import Vue from 'vue'
import VueRouter from 'vue-router'


import LoginMenu from '../views/Me/Center/LoginMenu.vue'
// 引入了加载效果
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'LoginMenu',
    active: 0,
    component: LoginMenu,
    meta: {
      til: '登录页',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/home',
    name: 'Home',
    active: 0,
    component: () => import('../views/Home/Home.vue'),
    meta: {
      til: '首页',
      hid1: false,
      hid: true,
      test:true
    },
    hidden: false,
    icon: 'iconfont icon-home-g',
    icon1: 'iconfont icon-zhuye'
  },
  {
    path: '/about',
    name: 'About',
    active: 1,
    component: () => import('../views/Me/Center/About.vue'),
    meta: {
      til: '技巧',
      hid1: false,
      hid: true,
      test:true
    },
    hidden: false,
    icon: 'iconfont icon-qingdan',
    icon1: 'iconfont icon-qingdanxinxishebeijichuxinxigongdanxinxi'
  },
  {
    path: '/center',
    name: 'Center',
    active: 2,
    component: () => import('../views/Center.vue'),
    meta: {
      til: '课程',
      hid1: false,
      hid: true,
      test:true
    },
    hidden: false,
    icon: 'iconfont icon-kecheng',
    icon1: 'iconfont icon-kechengguanli'
  },
  {
    path: '/myCenter',
    name: 'MyCenter',
    active: 3,
    component: () => import('../views/Me/Center/Center.vue'),
    meta: {
      til: '我的',
      hid1: false,
      hid: true,
      test:true
    },
    hidden: false,
    icon: 'iconfont icon-xiazai1',
    icon1: 'iconfont icon-gerenzhongxin'
  },
  {
    path: '/goods',
    name: 'Goods',
    active: 3,
    component: () => import('../views/Goods.vue'),
    meta: {
      til: '商品',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/login',
    name: 'Login',
    active: 0,
    component: () => import('../views/User/Login.vue'),
    meta: {
      til: '登录',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/order',
    name: 'Order',
    active: 3,
    component: () => import('../views/Me/Order/Order.vue'),
    meta: {
      til: '我的订单',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/clock',
    name: 'Clock',
    active: 3,
    component: () => import('../views/Me/Clock/Clock.vue'),
    meta: {
      til: '打卡',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/edit',
    name: 'Edit',
    active: 3,
    component: () => import('../views/Me/Edit/edit.vue'),
    meta: {
      til: '打卡',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
 
  {
    path: '/discount',
    name: 'Discount',
    active: 3,
    component: () => import('../views/Me/Discount/Discount.vue'),
    meta: {
      til: '优惠',
      hid: true,
      hid1: true,
      test:false
    },
    hidden: true,
  },
  
  {
    path: '/orderme',
    name: 'Orderme',
    active: 3,
    component: () => import('../views/Me/About/About.vue'),
    meta: {
      til: '关于我们',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/Deposit',
    name: 'Deposit',
    active: 3,
    component: () => import('../views/Me/Balance/Deposit.vue'),
    meta: {
      til: '充值记录',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/Consume',
    name: 'Consume',
    active: 3,
    component: () => import('../views/Me/Balance/Consume.vue'),
    meta: {
      til: '消费记录',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/banlance',
    name: 'Banlance',
    active: 3,
    component: () => import('../views/Me/Balance/Banlance.vue'),
    meta: {
      til: '我的余额',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/weather',
    name: 'Weather',
    active: 3,
    component: () => import('../views/Me/Center/Weather.vue'),
    meta: {
      til: '天气',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/echartTest2',
    name: 'EchartTest2',
    active: 3,
    component: () => import('../views/Me/Center/EchartTest2.vue'),
    meta: {
      til: 'echart2',
      hid1: false,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/menu',
    name: 'Menu',
    active: 1,
    component: () => import('../views/Me/Center/Menu.vue'),
    meta: {
      til: '菜单',
      hid1: true,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/message',
    name: 'Message',
    active: 0,
    component: () => import('../views/Me/Center/Message.vue'),
    meta: {
      til: '验证码登录',
      hid1: true,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/register1',
    name: 'Register1',
    active: 0,
    component: () => import('../views/Me/Center/Register1.vue'),
    meta: {
      til: '注册页面',
      hid1: true,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/discount',
    name: 'Discount',
    active: 0,
    component: () => import('../views/Me/Discount/Discount.vue'),
    meta: {
      til: '优惠券',
      hid1: true,
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/kuaixunde',
    name: 'Kuaixunde',
    active: 0,
    component: () => import('../views/Home/Kuaixun.vue'),
    meta: {
      til: '快讯详情',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/lesdetail',
    name: 'Lesdetail',
    active: 0,
    component: () => import('../views/Home/Lesdetail.vue'),
    meta: {
      til: '课程详情',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/common/:name',
    name: 'Common',
    active: 0,
    component: () => import('../views/Me/Center/Common.vue'),
    meta: {
      til: '通用菜单',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/search',
    name: 'Search',
    active: 0,
    component: () => import('../views/Home/search.vue'),
    meta: {
      til: '搜索',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/searchjg',
    name: 'Searchjg',
    active: 0,
    component: () => import('../views/Home/serachjg.vue'),
    meta: {
      til: '搜索结果界面',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/searchbujg',
    name: 'Searchbujg',
    active: 0,
    component: () => import('../views/Home/searchbujg.vue'),
    meta: {
      til: '搜索无结果界面',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/searchgjc',
    name: 'Searchgjc',
    active: 0,
    component: () => import('../views/Home/searchgjc.vue'),
    meta: {
      til: '关键词推荐',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/follow',
    name: 'Follow',
    active: 0,
    component: () => import('../views/Course/Follow/follow.vue'),
    meta: {
      til: '我的收藏',
      hid: true,
      test:false
    },
    hidden: true,
  },
  {
    path: '/skills',
    name: 'Skills',
    active: 0,
    component: () => import('../views/Course/Skills/Skills.vue'),
    meta: {
      til: '我的关注',
      hid: true,
      test:false
    },
    hidden: true,
  },
]

const router = new VueRouter({
  routes
})



export default router

router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
})

// 加载效果添加了一个定时器 可取消
router.afterEach(() => {
  setTimeout(() => {
    NProgress.done()
  });
})